// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import BaiduMap from 'vue2-baidu-map'
import echarts from 'echarts'
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';
import global from "./assets/js/Global";
Vue.prototype.global = global;
import Es6Promise from 'es6-promise'
import DictTag from '@/components/DictTag'
import mqttTool from '@/utils/mqttTool'
import { download } from '@/utils/request'
import './permission';



require('es6-promise').polyfill()
Es6Promise.polyfill()

import VueI18n from 'vue-i18n'
import LangENUS from './lang/en-us.js'
import LangZHCN from './lang/zh-cn.js'


import { BmlMarkerClusterer } from 'vue2-baidu-map';
Vue.component('bml-marker-clusterer', BmlMarkerClusterer)
Vue.use(VueI18n)
const i18n = new VueI18n({
  locale: "zh-cn",
  messages: {
    'en-us': LangENUS,
    'zh-cn': LangZHCN
  }
})
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})

export var Event = new Vue();

import {FormatDate} from './assets/js/formatDate.js';
import {getTime} from './assets/js/getTime.js';
Vue.prototype.FormatDate = FormatDate;
Vue.prototype.getTime = getTime;
if(sessionStorage.getItem("markerData4") == null){
  sessionStorage.setItem("markerData4", JSON.stringify([]));
}
//let base = process.env.NODE_ENV === 'production' ?'http://192.168.0.106:8080':'http://localhost:8080';
//Vue.prototype.baseURL = base;

Vue.component('DictTag', DictTag)


Vue.use(ElementUI);
Vue.prototype.$echarts = echarts
Vue.prototype.$mqttTool = mqttTool
Vue.prototype.download = download
Vue.config.productionTip = false

Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  //ak: 'Vgac2flKYxjgaiRimIS5YE0xq5Ieabur'
  ak: 'qwi9KBNSUMebWznpKvy7H7EH0SaCnLA0',
  type: 'WebGL' // 百度地图类型
})
const whiteRouter = ['/single']
/* eslint-disable no-new */
new Vue({
  //el: '#app',
  router,
  i18n,
  //components: { App },
  render: h => h(App)
  //template: '<App/>'
}).$mount("#app")
